<template>
  <div class="accountinfoadmin">
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="乡镇村">
        <el-cascader
          v-model="formInline.region"
          :options="formInline.options"
          @change="handleChange"
        />
      </el-form-item>
      <el-form-item label="年度">
        <el-input v-model="formInline.year" placeholder="请输入年度" />
      </el-form-item>
      <el-form-item label="项目名称">
        <el-input
          v-model="formInline.projectname"
          placeholder="请输入项目名称"
        />
      </el-form-item>
      <el-form-item label="姓名">
        <el-input v-model="formInline.name" placeholder="请输入姓名" />
      </el-form-item>
      <el-form-item label="身份证号">
        <el-input v-model="formInline.idCard" placeholder="请输入身份证号" />
      </el-form-item>
      <el-form-item>
        <el-button class="el-icon-search" @click="onSubmit">查询</el-button>
        <el-button class="el-icon-printer">打印</el-button>
        <el-button class="el-icon-edit">修改参保类型</el-button>
      </el-form-item>
    </el-form>
    <el-table :data="tableData" border style="width: 1831px" 
      :header-cell-style="{ 'text-align': 'center' }"
      :cell-style="{ 'text-align': 'center' }"
      :row-style="{ 'height': '48px'}">
      <el-table-column fixed="left" prop="id" label="序号" width="60" />
      <el-table-column prop="name" label="姓名" width="110" />
      <el-table-column prop="sex" label="性别" width="60" />
      <el-table-column prop="idCard" label="身份证号" width="180" />
      <el-table-column prop="tips" label="状态" width="180" />
      <el-table-column prop="tips" label="项目名称" width="180" />
      <el-table-column prop="guarantee" label="社保卡号" width="180" />
      <el-table-column prop="accountname" label="基准补贴年限" width="180" />
      <el-table-column
        prop="subsidy"
        label="享受困难补贴年限（月）"
        width="100"
      />
      <el-table-column
        prop="pension"
        label="职工养老缴费年限（月）"
        width="100"
      />
      <el-table-column prop="accountname" label="实际补贴年限" width="180" />
      <el-table-column prop="accountname" label="实际补贴金额" width="180" />
      <el-table-column prop="accountname" label="原有社保类型" width="180" />
      <el-table-column prop="accountname" label="社保缴费状态" width="180" />
      <el-table-column prop="accountname" label="参保类型" width="180" />
      <el-table-column prop="accountname" label="开户行" width="180" />
      <el-table-column prop="accountname" label="银行账号" width="180" />
      <el-table-column prop="accountname" label="登记日期" width="180" />
      <el-table-column fixed="right" label="征地项目详情" width="110">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="handleproject(scope.row)"
            >查看</el-button
          >
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="账户流水详情" width="110">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="handleflowing(scope.row)"
            >查看</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      :current-page.sync="currentPage1"
      :page-size="100"
      layout="prev, pager, next, jumper"
      :total="this.tableData.length"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
    <!-- 征地项目详情模态框 -->
    <el-dialog
      title="征地项目详情"
      :visible.sync="project"
      class="land"
      width="431px"
    >
      <el-form
        v-model="gridData"
        :label-position="labelPosition"
        label-width="130px"
        class="demo-form-inline"
      >
        <el-form-item label="乡镇">
          <el-input
            v-model="gridData.adddress"
            placeholder="乡镇"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="村">
          <el-input
            v-model="gridData.adddress"
            placeholder="村"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="年度">
          <el-input
            v-model="gridData.adddress"
            placeholder="年度"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="批次">
          <el-input
            v-model="gridData.adddress"
            placeholder="批次"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="项目名称">
          <el-input
            v-model="gridData.adddress"
            placeholder="项目名称"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="基准日期">
          <el-input
            v-model="gridData.adddress"
            placeholder="基准日期"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="计息日期">
          <el-input
            v-model="gridData.adddress"
            placeholder="计息日期"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="用地面积（亩）">
          <el-input
            v-model="gridData.adddress"
            placeholder="用地面积"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="区片价">
          <el-input
            v-model="gridData.adddress"
            placeholder="区片价"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="征缴比例 %">
          <el-input
            v-model="gridData.adddress"
            placeholder="征缴比例 %"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="社会保险费（元）">
          <el-input
            v-model="gridData.adddress"
            placeholder="社会保险费（元）"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="社平工资年度">
          <el-input
            v-model="gridData.adddress"
            placeholder="社平工资年度"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="社平工资">
          <el-input
            v-model="gridData.adddress"
            placeholder="社平工资"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="征地户数">
          <el-input
            v-model="gridData.adddress"
            placeholder="征地户数"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="征地人数">
          <el-input
            v-model="gridData.adddress"
            placeholder="征地人数"
            disabled
          ></el-input>
        </el-form-item>
      </el-form>
    </el-dialog>
    <!-- 账户流水详情模态框 -->
    <el-drawer
      title="账户流水详情"
      :visible.sync="table"
      direction="rtl"
      size="50%"
    >
      <el-table :data="gridInfo" 
      :header-cell-style="{ 'text-align': 'center' }"
      :cell-style="{ 'text-align': 'center' }"
      :row-style="{ 'height': '48px'}">
        <el-table-column property="address" label="类型" />
        <el-table-column property="address" label="金额" />
        <el-table-column property="address" label="余额" />
        <el-table-column property="address" label="时间" />
        <el-table-column property="address" label="备注" />
      </el-table>
    </el-drawer>
  </div>
</template>
<script>
export default {
  name: "",
  data() {
    return {
      msg: "账户信息管理（城居保）",
      formInline: {
        user: "",
        region: [],
        /* 乡镇村数据模拟模型 */
        options: [],
      },
      tableData: [],
      project: false, // 征地项目详情显示隐藏
      flowing: false, // 账户流水详情显示隐藏
      gridData: [], // 征地项目表格数据
      gridInfo: [], // 账户流水详情数据
      currentPage1: 1,
      title: "",
      table: false,
      labelPosition: "right", // 征地项目详情输入框文字右对齐
    };
  },
  methods: {
    onSubmit() {
      console.log("submit!");
    },
    handleChange(value) {
      console.log(value);
    },
    handleproject(row) {
      console.log(row + 1);
      this.project = true;
    },
    handleflowing(row) {
      console.log(row + 22);
      this.table = true;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    addgsForm() {
      this.project = true;
      this.title = "征地项目详情";
    },
  },
};
</script>

<style scoped lang="scss">
.accountinfoadmin {
  padding: 30px;
  .el-pagination {
    max-width: 1830px;
    text-align: right;
  }
  .el-drawer__header {
    user-select: none;
  }
}
</style>
